﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
using System.Collections;

namespace MVCTippSpielManagement.Management
{
	[XmlRoot("UserMenu")]
	public class UserMenu
	{

		//private List<MenuItem> _MainMenu;
		private ArrayList _MenuEntries;

		#region Konstruktor

		public UserMenu()
		{
			//_MainMenu = new List<MenuItem>();
			_MenuEntries = new ArrayList();
		}
		#endregion

		public bool EnableMenuItem(string menuItem, bool enabled)
		{
			//MenuItem ausgrauen/disablen und bei erfolg true zurückgeben
			return true;
		}

		public void Add(MyMenuItem _Item)
		{
			_MenuEntries.Add(_Item);
		}


		[XmlElement("MyMenuItem")]

		public MyMenuItem[] Items
		{
			get
			{
				MyMenuItem[] items = new MyMenuItem[_MenuEntries.Count];
				_MenuEntries.CopyTo(items);
				return items;
			}
			set
			{
				if (value == null) return;
				MyMenuItem[] items = (MyMenuItem[])value;
				_MenuEntries.Clear();
				foreach (MyMenuItem item in items)
					_MenuEntries.Add(item);
			}
		}
	}
}
